<?php /* Smarty version 2.6.18, created on 2010-03-16 11:25:43
         compiled from listdispatchorder.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'listdispatchorder.tpl', 78, false),array('modifier', 'count', 'listdispatchorder.tpl', 111, false),array('function', 'cycle', 'listdispatchorder.tpl', 147, false),)), $this); ?>
<div id="blanket" style="display:none;"></div>
<div id="details" style="position:absolute;background-color:#fff;width:400px;z-index: 1002;display:none;">
</div>
<div id="savetoexcel" style="position:absolute;background-color:#fff;width:400px;z-index: 1002;display:none;">
</div>
<style type="text/css"> 
<?php echo '
	.imgCalc1 { position:relative;}
	.imgCalc2 { position:relative;}
	#f_div { display:none; position:absolute;} 
	#t_div { display:none; position:absolute;} 
'; ?>

</style>
<script type="text/javascript">	
	//var calendar1 = new ekimo_calendar("f_show","f_date","Date From", "f_div");
	//var calendar1 = new ekimo_calendar("t_show","t_date","Date To", "t_div");
	<?php echo '
										Calendar.setup({
									        inputField     :    "user[date_from]",     // id of the input field
									        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
									        displayArea    :    "fromContainer",
									        daFormat       :    "%Y-%m-%d",      // format of the display area
									        button         :    "f_trigger_c1",  // trigger for the calendar (button ID)
									        align          :    "Bl",           // alignment (defaults to "Bl")
									        singleClick    :    true,
											//onUpdate	   :    endDateChanged, //event to call after calendar is closed
									        weekNumbers    :    false
									    });
									    
									    Calendar.setup({
									        inputField     :    "user[date_to]",     // id of the input field
									        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
									        displayArea    :    "toContainer",
									        daFormat       :    "%Y-%m-%d",      // format of the display area
									        button         :    "f_trigger_c2",  // trigger for the calendar (button ID)
									        align          :    "Bl",           // alignment (defaults to "Bl")
									        singleClick    :    true,
											//onUpdate	   :    endDateChanged, //event to call after calendar is closed
									        weekNumbers    :    false
									    });
	'; ?>

</script>
<form name="mainForm" method="POST" id="mainForm">
<?php if (! $this->_tpl_vars['search']): ?>
    	<h1>View Dispatch Order</h1>
        <div class="blue">
        <p class="right"><a href="javascript:void(0);" onclick="showsearch('search');"><img id="show_arrow" alt="Show Search" src="/app/default/www/images/arrow-down.png" border="0"/></a></p>
		<p class="left"><div style="display:block;" id="search">
			<table border="0" width="100%">
				<tr>
					<td width="10%">Country:</td>
					<td>
						<select name="search[country]">
								<option value="">--- Select Country ---</option>
							<?php $_from = $this->_tpl_vars['country']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
								<option value="<?php echo $this->_tpl_vars['item']['country_code']; ?>
"><?php echo $this->_tpl_vars['item']['country']; ?>
</option>
							<?php endforeach; endif; unset($_from); ?>
						</select>
					</td>
				</tr>
				<tr>
					<td>Customer:</td>
					<td><select name="search[customer]">
							<option value="">--- Select Customer ---</option>
							<?php $_from = $this->_tpl_vars['customers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['suppitem']):
?>
								<option value="<?php echo $this->_tpl_vars['suppitem']['org_id']; ?>
"><?php echo $this->_tpl_vars['suppitem']['supplier']; ?>
</option>
							<?php endforeach; endif; unset($_from); ?>
					</select></td>
				</tr>
				<tr>
					<td>Date From:</td>
					<td>
						<!-- label for="f_date">
							<input type="text" name="search[date_from]" id="f_date" readonly="true">
							<a href="javascript:void(0);" id="f_show"><img alt="Calendar" src="/app/default/www/images/calendar.jpg" border="0"/></a>
							<div id="f_div"></div>
						</label -->
						<span id="fromContainer" class="formfields" style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>
						<input style="float:left" type="hidden" name="search[date_from]"  value="<?php echo $this->_tpl_vars['date']; ?>
" id="search[date_from]"> 
						<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c1" style="cursor: pointer; border: 0px ;" title="Date selector"  />
						<input type="hidden" name="dateYui" value="search[date_from]/fromContainer/f_trigger_c1">
					</td>
				</tr>
				<tr>
					<td>Date To:</td>
					<td>
						<!-- label for="t_date">
							<input type="text" name="search[date_to]" id="t_date" readonly="true">
							<a href="javascript:void(0);" id="t_show"><img alt="Calendar" src="/app/default/www/images/calendar.jpg" border="0"/></a>
							<div id="t_div"></div>
							&nbsp;&nbsp;
							<input type="button" value="Search" onclick="doajaxAction('/account/viewDispatchOrder/usersearch/1',1,'results',document.getElementById('mainForm'))"></td>
						</label-->
						<span id="toContainer" class="formfields" style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>
						<input style="float:left" type="hidden" name="search[date_to]"  value="<?php echo $this->_tpl_vars['date']; ?>
" id="search[date_to]"> 
						<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c2" style="cursor: pointer; border: 0px ;" title="Date selector"  />
						<input type="hidden" name="dateYui" value="search[date_to]/toContainer/f_trigger_c2">
						&nbsp;&nbsp;
						<input type="button" value="Search" onclick="doajaxAction('/account/viewDispatchOrder/usersearch/1',1,'results',document.getElementById('mainForm'))">
						&nbsp;<input type="button" value="Save to Excel" onclick="doajaxAction('/account/savetoexcel/view/ors',0,'savetoexcel');popup('savetoexcel');">
				</tr>
			</table>
		</div></p>
        
        </div>
<div class="white"></div>
<div class="blue" id="pagination">
	<table border=0 width="100%">
		<tr>
			<td align="center">
			<?php $this->assign('page', count($this->_tpl_vars['pagelist']['pagelength'])); ?>
			<?php $_from = $this->_tpl_vars['pagelist']['pagelength']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['data']):
?>
				<div id=<?php echo $this->_tpl_vars['key']; ?>
 <?php if ($this->_tpl_vars['key'] == 0): ?><?php else: ?>style="display:none"<?php endif; ?>>
				<?php if ($this->_tpl_vars['key'] > 0 && $this->_tpl_vars['page'] > 10): ?>&nbsp;<a href="javascript:void(0);" onclick="backpage(<?php echo $this->_tpl_vars['key']; ?>
)"> << </a><?php endif; ?>
				<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
					<a href="javascript:void(0);"				onclick="doajaxAction('<?php echo $this->_tpl_vars['pagelist']['action']; ?>
/page/<?php echo $this->_tpl_vars['item']; ?>
',0,'results')"><?php echo $this->_tpl_vars['item']; ?>
</a>&nbsp;
				<?php endforeach; endif; unset($_from); ?>
				<?php if ($this->_tpl_vars['page'] > 10): ?>
				&nbsp;<a href="javascript:void(0);" onclick="forwardpage(<?php echo $this->_tpl_vars['key']; ?>
)"> >> </a>
				<?php endif; ?>
				</div>
				
			<?php endforeach; endif; unset($_from); ?>
			</td>
		</tr>
	</table>
</div>
<div class="white"></div>   
		<?php endif; ?>
           
            <div id="results">
				
                <!-- **************repeat here*************** -->
                
                <div>  
					<table width="100%">
						<tr>
							<td><strong>PO Code</strong></td>
							<td align="center"><strong>Customer</strong></td>
							<td align="center"><strong>Carrier Type</strong></td>
							<td align="center"><strong>Carrier Name</strong></td>
							<td align="center"><strong>Carrier Code</strong></td>
							<td align="center"><strong>Dispatch Date</strong></td>
						</tr>
						<tr><td colspan="6"><hr></td></tr>
						<?php $_from = $this->_tpl_vars['shipments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
						<tr class="<?php echo smarty_function_cycle(array('values' => "blue,notify"), $this);?>
">
							<td><a href="javascript:void(0);" onclick="doajaxAction('/account/viewShipmentDetails/shipment_id/<?php echo $this->_tpl_vars['item']['shipment_id']; ?>
',0,'details');popup('details');"><?php echo $this->_tpl_vars['item']['po_no']; ?>
</a></td>
							<td><?php echo $this->_tpl_vars['item']['name']; ?>
</td>
							<td align="right"><?php echo $this->_tpl_vars['item']['carrier_type']; ?>
</td>
							<td align="center"><?php echo $this->_tpl_vars['item']['carrier_name']; ?>
</td>
							<td align="center"><?php echo $this->_tpl_vars['item']['carrier_code']; ?>
</td>
							<td align="center"><?php echo $this->_tpl_vars['item']['date_shipment']; ?>
</td>
						</tr>
						<?php endforeach; endif; unset($_from); ?>
					 </table>
            	</div>                
            </div>
</form>
<script language="javascript">
<?php echo '
	function showsearch(div) {
		//alert(\'hee\');
		divid = document.getElementById(div);
		if(divid.style.display == \'none\') {
			divid.style.display = \'block\';
			document.getElementById(\'show_arrow\').src = "/app/default/www/images/arrow-up.png";
		} else {
			divid.style.display = \'none\';
			document.getElementById(\'show_arrow\').src = "/app/default/www/images/arrow-down.png";
		}
	}
'; ?>

</script>

            